Access to attribute types

A little problem here:
I want to set access to attribute types via DXL to inherited.
according to the reference manual it could be done like this:

ModuleProperties mp
ModuleVersion mv
Module m = current
mv = moduleVersion(m)
string err1 = getProperties (mv, mp)
for at in mp do {
inherited (m, at)
}

but somehow it doesn't work.
any ideas?

Karl
kabr - Mon Mar 30 07:50:10 EDT 2009

Re: Access to attribute types
dpechacek - Mon Mar 30 08:12:19 EDT 2009

Are you getting an error? I know the Module Properties type was added to allow you to get information on attributes in a module without opening it. Is the module open in read-only? Obviously you need the module open in exclusive edit to edit attributes.

Need a little more info. I typically get attributes through the module with a "for (AttrDef ad) in current Module" type loop.

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Re: Access to attribute types
kabr - Mon Mar 30 08:27:05 EDT 2009

Thanks David,
your questions made me look into the reference manual again
I just should have read on a bit further ...

the first entry in the reference index is "for AttrType in ModuleProperties", so I tried that one.
but a little bit further down there is "for attribute type in module" and this does what I want.

So

for at in module do {
inherited (m, at)
}

works fine, whereas

for at in ModuleProperties do {
inherited (m, at)
}

does not.

Re: Access to attribute types
ePiallat - Tue Mar 31 06:16:39 EDT 2009

kabr - Mon Mar 30 08:27:05 EDT 2009
Thanks David,
your questions made me look into the reference manual again
I just should have read on a bit further ...

the first entry in the reference index is "for AttrType in ModuleProperties", so I tried that one.
but a little bit further down there is "for attribute type in module" and this does what I want.

So

for at in module do {
inherited (m, at)
}

works fine, whereas

for at in ModuleProperties do {
inherited (m, at)
}

does not.

Hi,

DXL is a macro language: you can't do anything with it but what you can do through graphical user interface.
And because the GUI was written with DXL itself, reciprocity is true.
In this particular case, the "ModuleProperties" DXL type was created for DOORS 8.2 to handle "Access to module attribute values from the 'Module Properties' window when called from the database window".

The new type was necessary because the "Module Properties" window is accessible for unloaded modules. But the new type only implements was is strictly necessary to access properties:

  • Attribute Definitions to list the attribute, with access to values
  • Attribute Types for correct setup of the "Attribute Value" sub-window (View/Edit buuton), with access only to Base Type, boundaries and enumeration values.


Changing access right or definition of attributes and types needs an edit lock on the module anyway - thus, there is no need to access through the "ModuleProperties" object as the "edit" perm will return a "Module".
note also that "AttrType" and "AttrDef" structures are bound to the edit mode of the module. For instance, this will fail:

 

Module m    = read "foo/bar"
AttrType at = find (m,"SomeEnum")
 
m = edit "foo/bar"
inherited(m,at) // will fail because previoue "edit" destroyed at.



Nice! {code} is working now!

- Éric



 

Re: Access to attribute types
llandale - Tue Mar 31 10:40:05 EDT 2009

ePiallat - Tue Mar 31 06:16:39 EDT 2009

Hi,

DXL is a macro language: you can't do anything with it but what you can do through graphical user interface.
And because the GUI was written with DXL itself, reciprocity is true.
In this particular case, the "ModuleProperties" DXL type was created for DOORS 8.2 to handle "Access to module attribute values from the 'Module Properties' window when called from the database window".

The new type was necessary because the "Module Properties" window is accessible for unloaded modules. But the new type only implements was is strictly necessary to access properties:

  • Attribute Definitions to list the attribute, with access to values
  • Attribute Types for correct setup of the "Attribute Value" sub-window (View/Edit buuton), with access only to Base Type, boundaries and enumeration values.


Changing access right or definition of attributes and types needs an edit lock on the module anyway - thus, there is no need to access through the "ModuleProperties" object as the "edit" perm will return a "Module".
note also that "AttrType" and "AttrDef" structures are bound to the edit mode of the module. For instance, this will fail:

 

Module m    = read "foo/bar"
AttrType at = find (m,"SomeEnum")
 
m = edit "foo/bar"
inherited(m,at) // will fail because previoue "edit" destroyed at.



Nice! {code} is working now!

- Éric



 

Golly, didn't know that the at was bound to mod. That gives me the heebeegeebees; wonder what kind of errors are lurking inside my DXL right now... Wonder what sorts of other Variables are linked to Module like that....

> Louie